/*
 * 	Additional function for forms.html
 *	Written by ThemePixels	
 *	http://themepixels.com/
 *
 *	Copyright (c) 2012 ThemePixels (http://themepixels.com)
 *	
 *	Built for Amanda Premium Responsive Admin Template
 *  http://themeforest.net/category/site-templates/admin-templates
 */
jQuery("#crawlerSimple").submit(function() {
		if (jQuery("[name='code_name']").val() == "") {
			alert("不能为空")
			return false;
		}
		
		if (jQuery("[name='url']").val() == "") {
			alert("不能为空")
			return false;
		}
		tijiaos();
		return false;
})

jQuery("#userinfo").submit(function() {
		if (jQuery("[name='name']").val() == "") {
			alert("不能为空")
			return false;
		}
		
		if (jQuery("[name='phone']").val() == "") {
			alert("不能为空")
			return false;
		}
		userinfo();
		return false;
})

jQuery("#userpassword").submit(function() {
		if (jQuery("input [name='passwordyuan']").val() == "") {
			alert("不能为空")
			return false;
		}
		
		if (jQuery("input [name='passwoed']").val() == "") {
			alert("不能为空")
			return false;
		}
		if (jQuery("input [name='passwoed']").val() != jQuery("input [name='passwoed1']").val()) {
			alert("两次密码不一致")
			return false;
		}
		passwordUpdate();
		return false;
})



function tijiaos(){
	jQuery.ajax({
		url:getUrl()+"/admin/crawler/create_crawler",
		type:"post",
		data:jQuery("#crawlerSimple").serialize(),
		success:function(data){
			console.log(data)
		}
	})
}